/**
 * VisitStatus枚举
 *
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/1/15
 */
package com.sxf.crm.enums;


/**
 * 拜访状态枚举
 */
public enum VisitStatus {
    PLANNED("计划中", "拜访计划已创建，但尚未执行"),
    COMPLETED("已完成", "拜访已经完成"),
    CANCELLED("已取消", "拜访已被取消");

    private final String displayName;
    private final String description;

    VisitStatus(String displayName, String description) {
        this.displayName = displayName;
        this.description = description;
    }

    public String getDisplayName() {
        return displayName;
    }

    public String getDescription() {
        return description;
    }

    public static VisitStatus fromDisplayName(String displayName) {
        for (VisitStatus status : VisitStatus.values()) {
            if (status.getDisplayName().equals(displayName)) {
                return status;
            }
        }
        throw new IllegalArgumentException("无效的拜访状态: " + displayName);
    }
} 